package com.platform.entity;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 小米体脂称健康数据实体
 * 表名 nideshop_mi_health_data
 *
 * @author LarkerJin
 * @email 277901879@qq.com
 * @date 2019-10-21 14:15:38
 */
public class MiHealthDataEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    //
    private Integer id;
    //会员id
    private Integer userId;
    //会员昵称
    private String nickName;
    //身体得分
    private Integer score;
    //称重时间
    private String createDate;
    //体重
    private BigDecimal weight;
    //体重描述
    private String weightDesc;
    //体型指标
    private String weightTarget;
    //BMI
    private BigDecimal bmi;
    //BMI描述
    private String bmiDesc;
    //BMI达标情况
    private Integer bmiExplain;
    //体脂
    private BigDecimal bodyfat;
    //体脂描述
    private String bodyfatDesc;
    //体脂达标情况
    private Integer bodyfatExplain;
    //人体水分
    private BigDecimal bodyWater;
    //人体水分描述
    private String bodyWaterDesc;
    //人体水分达标情况
    private Integer bodyWaterExplain;
    //蛋白质
    private BigDecimal protein;
    //蛋白质描述
    private String proteinDesc;
    //蛋白质达标情况
    private Integer proteinExplain;
    //基础代谢（千卡）
    private Integer basalMetabolism;
    //基础代谢描述
    private String basalMetabolismDesc;
    //基础代谢达标情况
    private Integer basalMetabolismExplain;
    //肌肉
    private BigDecimal muscle;
    //肌肉描述
    private String muscleDesc;
    //肌肉达标情况
    private Integer muscleExplain;
    //内脏脂肪
    private Integer visceralFat;
    //内脏脂肪描述
    private String visceralFatDesc;
    //内脏脂肪达标情况
    private Integer visceralFatExplain;
    //骨量
    private BigDecimal boneMass;
    //骨量描述
    private String boneMassDesc;
    //骨量达标情况
    private Integer boneMassExplain;

    private Integer isInit;
    
    /**
     * 体重差额
     */
    private Double weightDifference;
    
    /**
     * 体脂差额
     */
    private Double bodyfatDifference;
    
    public Integer getIsInit() {
    	if(isInit == null)
    		return 0;
		return isInit;
	}

	public void setIsInit(Integer isInit) {
		this.isInit = isInit;
	}

	/**
     * 设置：
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取：
     */
    public Integer getId() {
        return id;
    }
    /**
     * 设置：会员id
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * 获取：会员id
     */
    public Integer getUserId() {
        return userId;
    }
    /**
     * 设置：会员昵称
     */
    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    /**
     * 获取：会员昵称
     */
    public String getNickName() {
        return nickName;
    }
    /**
     * 设置：身体得分
     */
    public void setScore(Integer score) {
        this.score = score;
    }

    /**
     * 获取：身体得分
     */
    public Integer getScore() {
        return score;
    }
    /**
     * 设置：称重时间
     */
    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    /**
     * 获取：称重时间
     */
    public String getCreateDate() {
        return createDate;
    }
    /**
     * 设置：体重
     */
    public void setWeight(BigDecimal weight) {
        this.weight = weight;
    }

    /**
     * 获取：体重
     */
    public BigDecimal getWeight() {
        return weight;
    }
    /**
     * 设置：体重描述
     */
    public void setWeightDesc(String weightDesc) {
        this.weightDesc = weightDesc;
    }

    /**
     * 获取：体重描述
     */
    public String getWeightDesc() {
        return weightDesc;
    }
    /**
     * 设置：体型指标
     */
    public void setWeightTarget(String weightTarget) {
        this.weightTarget = weightTarget;
    }

    /**
     * 获取：体型指标
     */
    public String getWeightTarget() {
        return weightTarget;
    }
    /**
     * 设置：BMI
     */
    public void setBmi(BigDecimal bmi) {
        this.bmi = bmi;
    }

    /**
     * 获取：BMI
     */
    public BigDecimal getBmi() {
        return bmi;
    }
    /**
     * 设置：BMI描述
     */
    public void setBmiDesc(String bmiDesc) {
        this.bmiDesc = bmiDesc;
    }

    /**
     * 获取：BMI描述
     */
    public String getBmiDesc() {
        return bmiDesc;
    }
    /**
     * 设置：BMI达标情况
     */
    public void setBmiExplain(Integer bmiExplain) {
        this.bmiExplain = bmiExplain;
    }

    /**
     * 获取：BMI达标情况
     */
    public Integer getBmiExplain() {
        return bmiExplain;
    }
    /**
     * 设置：体脂
     */
    public void setBodyfat(BigDecimal bodyfat) {
        this.bodyfat = bodyfat;
    }

    /**
     * 获取：体脂
     */
    public BigDecimal getBodyfat() {
        return bodyfat;
    }
    /**
     * 设置：体脂描述
     */
    public void setBodyfatDesc(String bodyfatDesc) {
        this.bodyfatDesc = bodyfatDesc;
    }

    /**
     * 获取：体脂描述
     */
    public String getBodyfatDesc() {
        return bodyfatDesc;
    }
    /**
     * 设置：体脂达标情况
     */
    public void setBodyfatExplain(Integer bodyfatExplain) {
        this.bodyfatExplain = bodyfatExplain;
    }

    /**
     * 获取：体脂达标情况
     */
    public Integer getBodyfatExplain() {
        return bodyfatExplain;
    }
    /**
     * 设置：人体水分
     */
    public void setBodyWater(BigDecimal bodyWater) {
        this.bodyWater = bodyWater;
    }

    /**
     * 获取：人体水分
     */
    public BigDecimal getBodyWater() {
        return bodyWater;
    }
    /**
     * 设置：人体水分描述
     */
    public void setBodyWaterDesc(String bodyWaterDesc) {
        this.bodyWaterDesc = bodyWaterDesc;
    }

    /**
     * 获取：人体水分描述
     */
    public String getBodyWaterDesc() {
        return bodyWaterDesc;
    }
    /**
     * 设置：人体水分达标情况
     */
    public void setBodyWaterExplain(Integer bodyWaterExplain) {
        this.bodyWaterExplain = bodyWaterExplain;
    }

    /**
     * 获取：人体水分达标情况
     */
    public Integer getBodyWaterExplain() {
        return bodyWaterExplain;
    }
    /**
     * 设置：蛋白质
     */
    public void setProtein(BigDecimal protein) {
        this.protein = protein;
    }

    /**
     * 获取：蛋白质
     */
    public BigDecimal getProtein() {
        return protein;
    }
    /**
     * 设置：蛋白质描述
     */
    public void setProteinDesc(String proteinDesc) {
        this.proteinDesc = proteinDesc;
    }

    /**
     * 获取：蛋白质描述
     */
    public String getProteinDesc() {
        return proteinDesc;
    }
    /**
     * 设置：蛋白质达标情况
     */
    public void setProteinExplain(Integer proteinExplain) {
        this.proteinExplain = proteinExplain;
    }

    /**
     * 获取：蛋白质达标情况
     */
    public Integer getProteinExplain() {
        return proteinExplain;
    }
    /**
     * 设置：基础代谢（千卡）
     */
    public void setBasalMetabolism(Integer basalMetabolism) {
        this.basalMetabolism = basalMetabolism;
    }

    /**
     * 获取：基础代谢（千卡）
     */
    public Integer getBasalMetabolism() {
        return basalMetabolism;
    }
    /**
     * 设置：基础代谢描述
     */
    public void setBasalMetabolismDesc(String basalMetabolismDesc) {
        this.basalMetabolismDesc = basalMetabolismDesc;
    }

    /**
     * 获取：基础代谢描述
     */
    public String getBasalMetabolismDesc() {
        return basalMetabolismDesc;
    }
    /**
     * 设置：基础代谢达标情况
     */
    public void setBasalMetabolismExplain(Integer basalMetabolismExplain) {
        this.basalMetabolismExplain = basalMetabolismExplain;
    }

    /**
     * 获取：基础代谢达标情况
     */
    public Integer getBasalMetabolismExplain() {
        return basalMetabolismExplain;
    }
    /**
     * 设置：肌肉
     */
    public void setMuscle(BigDecimal muscle) {
        this.muscle = muscle;
    }

    /**
     * 获取：肌肉
     */
    public BigDecimal getMuscle() {
        return muscle;
    }
    /**
     * 设置：肌肉描述
     */
    public void setMuscleDesc(String muscleDesc) {
        this.muscleDesc = muscleDesc;
    }

    /**
     * 获取：肌肉描述
     */
    public String getMuscleDesc() {
        return muscleDesc;
    }
    /**
     * 设置：肌肉达标情况
     */
    public void setMuscleExplain(Integer muscleExplain) {
        this.muscleExplain = muscleExplain;
    }

    /**
     * 获取：肌肉达标情况
     */
    public Integer getMuscleExplain() {
        return muscleExplain;
    }
    /**
     * 设置：内脏脂肪
     */
    public void setVisceralFat(Integer visceralFat) {
        this.visceralFat = visceralFat;
    }

    /**
     * 获取：内脏脂肪
     */
    public Integer getVisceralFat() {
        return visceralFat;
    }
    /**
     * 设置：内脏脂肪描述
     */
    public void setVisceralFatDesc(String visceralFatDesc) {
        this.visceralFatDesc = visceralFatDesc;
    }

    /**
     * 获取：内脏脂肪描述
     */
    public String getVisceralFatDesc() {
        return visceralFatDesc;
    }
    /**
     * 设置：内脏脂肪达标情况
     */
    public void setVisceralFatExplain(Integer visceralFatExplain) {
        this.visceralFatExplain = visceralFatExplain;
    }

    /**
     * 获取：内脏脂肪达标情况
     */
    public Integer getVisceralFatExplain() {
        return visceralFatExplain;
    }
    /**
     * 设置：骨量
     */
    public void setBoneMass(BigDecimal boneMass) {
        this.boneMass = boneMass;
    }

    /**
     * 获取：骨量
     */
    public BigDecimal getBoneMass() {
        return boneMass;
    }
    /**
     * 设置：骨量描述
     */
    public void setBoneMassDesc(String boneMassDesc) {
        this.boneMassDesc = boneMassDesc;
    }

    /**
     * 获取：骨量描述
     */
    public String getBoneMassDesc() {
        return boneMassDesc;
    }
    /**
     * 设置：骨量达标情况
     */
    public void setBoneMassExplain(Integer boneMassExplain) {
        this.boneMassExplain = boneMassExplain;
    }

    /**
     * 获取：骨量达标情况
     */
    public Integer getBoneMassExplain() {
        return boneMassExplain;
    }

	public Double getWeightDifference() {
		if(weightDifference == null)
			return 0.0;
		return weightDifference;
	}

	public Double getBodyfatDifference() {
		if(bodyfatDifference == null)
			return 0.0;
		return bodyfatDifference;
	}

	public void setInitHealthData(MiHealthDataEntity initData) {
		weightDifference = this.weight.doubleValue() - initData.getWeight().doubleValue();
		bodyfatDifference = this.bodyfat.doubleValue()*this.weight.doubleValue() - initData.getBodyfat().doubleValue()*initData.getWeight().doubleValue();
	}
}
